package spindles.gwt.server;

import spindles.gwt.server.util.SimplePrincipal;
import spindles.gwt.shared.UserDTO;
import spindles.gwt.shared.UserManager;

import com.google.gwt.user.server.rpc.RemoteServiceServlet;

public class UserServlet extends RemoteServiceServlet implements UserManager{

	/**
	 * 
	 */
	private static final long serialVersionUID = -213074020201092503L;

	public UserDTO getUserDTO() {
		SimplePrincipal user =  (SimplePrincipal)getThreadLocalRequest().getUserPrincipal();		
		
		UserDTO dto = (UserDTO)ServletUtil.map(user.getUser(), UserDTO.class);		
		return dto;
	}

}
